
poshidprobs_guess = 1./(1 + exp(-rate_matrix*vishid - repmat(hidbiases,size(rate_matrix,1),1)));    
%poshidstates_guess = poshidprobs_guess > rand(numcases,numhid);
negdata = 1./(1 + exp(-poshidprobs_guess*vishid' - repmat(visbiases,size(rate_matrix,1),1)));

negdata = negdata.*test_template;

mae = sum(sum(abs(negdata-test_real_matrix)))*5/test_size;
mae_round = sum(sum(abs(round(5*negdata)-test_real_matrix*5)))/test_size;
fprintf(1, 'epoch %4i error %6f  MAE %6f \n', epoch, mae, mae_round);

